home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6618 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.5 KB  |  81 lines

  1. Newsgroups: comp.lang.c
  2. Path: lafn.org!an234
  3. From: an234@lafn.org (Andres Lessing)
  4. Subject: Re: PROBLEMS WITH A STRUCTURE...
  5. X-Nntp-Posting-Host: lafn.org
  6. Message-ID: <1996Feb17.211507.13401@lafn.org>
  7. Sender: news@lafn.org
  8. Reply-To: an234@lafn.org (Andres Lessing)
  9. Organization: The Los Angeles Free-Net
  10. References: <4g3c55$413@hermes.fundp.ac.be>  
  11. Date: Sat, 17 Feb 1996 21:15:07 GMT
  12.  
  13.  
  14. In a previous article, fmelo (Francisco Melo Ledermann) says:
  15.  
  16. >Hi Everybody !, I have a problem with the initialization of a structure 
  17. >that I have denominated "aa_specifications". This structure is an array
  18. >of other structure called "aa_specification". The structure's definitions
  19. >are:
  20. >
  21. >
  22. >typedef char string3 [4];
  23. >
  24. >typedef string3 atom_name [3];
  25. >
  26. >struct aa_specification
  27. >                         {
  28. >                           atom_name atoms_in_distance [6];
  29. >                       };
  30. >
  31. >struct aa_specification aa_specifications [20];
  32. >
  33. >
  34. >Finally, the initialization of one part of the table is:
  35. >
  36. >
  37. >/* initialization of the aminoacid's specifications */
  38. >
  39. >aa_specifications[0].atoms_in_distance[0] = {"X","X","X"};
  40. >aa_specifications[0].atoms_in_distance[1] = {"CB","X","X"};
  41. >aa_specifications[0].atoms_in_distance[2] = {"CG1","CG2","X"};
  42. >aa_specifications[0].atoms_in_distance[3] = {"CD","X","X"};
  43. >aa_specifications[0].atoms_in_distance[4] = {"CE1","CE2","CE3"};
  44. >aa_specifications[0].atoms_in_distance[5] = {"X","X","X"};
  45. >aa_specifications[0].atoms_in_distance[6] = {"X","X","X"};
  46. >
  47. >
  48. >but this doesn't work. When I compile this code I receive the next error
  49. >message (in this case is the example only for the first line of the
  50. >initialization):
  51. >
  52. >cfe: Error: calc.c, line 45: Syntax Error 
  53. > aa_specifications[0].atoms_in_distance[0] = {"X","X","X"}; 
  54. > --------------------^ 
  55. >cfe: Error: calc.c, line 45: Empty declaration specifiers 
  56. > aa_specifications[0].atoms_in_distance[0] = {"X","X","X"}; 
  57. > ---------------------^ 
  58. >
  59. >
  60. >
  61. >Somebody know what is going on here ?. I don't know too much about C
  62. >language and if somebody can tell me how can I set and modify values in
  63. >a variable with this structure would be great for me !. In advance, thank
  64. >you very much, best wishes,
  65. >
  66. >Francisco Melo Ledermann.
  67. >
  68. >mailto:fmelo@biq.fundp.ac.be
  69. >
  70. >http://biq-pc1.biq.fundp.ac.be/index.html
  71. >
  72. >
  73.  
  74. Try changing the "X" to 'X'
  75.  
  76. -- 
  77.  Hofstadter's Law:                   |       o__
  78.     It always takes longer than you expect, even   |     _.</)_
  79.     when you take Hofstadter's Law into account.   |    (_) \(_)
  80.         " Godel Escher Bach"               | Andres, an234@lafn.org
  81.